import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import ConfigElementType 1.0
import "qrc:/qmlComponents/ConfigManager"

Item {
    RowLayout{
        spacing: 20

        GroupBox{
            Layout.alignment: Qt.AlignTop
            title: qsTr("SensorTraySideTwoDimensionCalibration")
            topPadding: 10

            ColumnLayout{
                ObjectEditor{
                    configModel: stSideTwoDimensionCalibrationParam
                    sectionName: qsTr("CalibrationParameter")
                    Component.onCompleted: {
                        init(false)
                    }
                }
                RowLayout{
                    Label{
                        text: qsTr("RowIndex:")
                    }
                    TextField{
                        id: txtRowIndex
                        text: "0"
                        validator: IntValidator{
                            bottom: 0
                        }
                        implicitWidth: 60
                        selectByMouse: true
                    }
                    CheckBox{
                        id: ckbCalibrateAllRows
                        text: qsTr("CalibrateAllRows")
                        checked: true
                    }

                    Button{
                        text: qsTr("DoCalibration")
                        onClicked: {
                            tem.runSingleCmd(bonderHead, "doSensorTraySideTwoDimensionCalibration", [txtRowIndex.text, ckbCalibrateAllRows.checked])
                        }
                    }
                }
            }
        }

        GroupBox{
            Layout.alignment: Qt.AlignTop
            title: qsTr("LensTraySideTwoDimensionCalibration")
            topPadding: 10

            ColumnLayout{
                ObjectEditor{
                    configModel: ltSideTwoDimensionCalibrationParam
                    sectionName: qsTr("CalibrationParameter")
                    Component.onCompleted: {
                        init(false)
                    }
                }
                Button{
                    text: qsTr("DoCalibration")
                    onClicked: {
                        tem.runSingleCmd(bonderHead, "doLensTraySideTwoDimensionCalibration")
                    }
                }
            }
        }
    }
}
